"use strict";
cc._RF.push(module, 'b4e8fMG3UNICKL7lkjnLYv2', 'BlockSc');
// Script/BlockSc.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * 字块
 */
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var BlockSc = /** @class */ (function (_super) {
    __extends(BlockSc, _super);
    function BlockSc() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.sp = null;
        _this.str = null;
        _this.sparr = [];
        _this.comeId = -1; //来源位置
        _this.right = false;
        _this.weizhistr = ''; //空格序号
        _this.selectIndex = -1; //选中序号
        return _this;
        // update (dt) {}
    }
    BlockSc.prototype.onLoad = function () {
        this.comeId = -1;
        this.right = !1;
        this.weizhistr = '';
        this.selectIndex = 0;
    };
    BlockSc.prototype.start = function () {
    };
    /**
     * 设置节点位置
     */
    BlockSc.prototype.setPos = function (pos) {
        this.node.position = pos;
    };
    /**
     * 设置节点名称
     * @param str
     */
    BlockSc.prototype.setName = function (str) {
        if (str) {
            this.node.name = str;
        }
    };
    /**
     * 设置底框
     * @param id
     */
    BlockSc.prototype.setSp = function (id) {
        if (this.right == !0)
            return;
        //console.log('设置底框',id)
        if (id != null || id != undefined) {
            this.sp.spriteFrame = this.sparr[id];
            if (id == 1)
                this.setRight(true);
        }
        else {
            this.sp.spriteFrame = null;
        }
    };
    /**
     * 设置字
     * @param str
     */
    BlockSc.prototype.setStr = function (str) {
        this.str.string = str;
    };
    /**
     * 答题字块 是否正确
     */
    BlockSc.prototype.setRight = function (isright) {
        this.right = isright;
    };
    BlockSc.prototype.getRight = function () {
        return this.right;
    };
    BlockSc.prototype.setComeId = function (id) {
        this.comeId = id;
    };
    __decorate([
        property(cc.Sprite)
    ], BlockSc.prototype, "sp", void 0);
    __decorate([
        property(cc.Label)
    ], BlockSc.prototype, "str", void 0);
    __decorate([
        property([cc.SpriteFrame])
    ], BlockSc.prototype, "sparr", void 0);
    BlockSc = __decorate([
        ccclass
    ], BlockSc);
    return BlockSc;
}(cc.Component));
exports.default = BlockSc;

cc._RF.pop();